-
-
Notifications
You must be signed in to change notification settings - Fork 15
📑 Reporter Refactor: Adds support for new teal_report
and teal_card
class
#884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Code Coverage Summary
Diff against main
Results for commit: 7c2dc13 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 22 suites 2s ⏱️ Results for commit 7c2dc13. ♻️ This comment has been updated with latest results. |
Companion to insightsengineering/teal.reporter#334 Consequence of changing naming convention for `teal_report` object. --------- Co-authored-by: André Veríssimo <[email protected]>
…l_data` (#255) # Pull Request Fixes: - insightsengineering/teal#1526 Built on top of: - insightsengineering/teal.reporter#307 - _(#307 will be closed once this PR is stable)_ ### Companion PRs: - insightsengineering/teal#1541 - #255 - insightsengineering/teal.data#370 - insightsengineering/teal.reporter#331 - insightsengineering/teal.modules.general#884 ### Changes description - [x] Add new parameter `cache` - Caches the result of the last evaluation in the respective `@code` slot - [ ] Decide on name - [x] Remove signature with multiple arguments to allow overriding `eval_code` in other packages without showing a note ``` r pkgload::load_all("teal.code") #> ℹ Loading teal.code q <- qenv() |> eval_code(1 + 1, cache = TRUE) |> eval_code(mtcars <- head(mtcars)) attr(q@code[[1]], "cache") #> [1] 2 ``` <sup>Created on 2025-06-03 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> --------- Co-authored-by: Dawid Kaledkowski <[email protected]> Co-authored-by: Marcin <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
…l_data` (#370) # Pull Request Fixes: - insightsengineering/teal#1526 Built on top of: - insightsengineering/teal.reporter#307 - _(#307 will be closed once this PR is stable)_ ### Companion PRs: - insightsengineering/teal#1541 - insightsengineering/teal.code#255 - #370 - insightsengineering/teal.reporter#331 - insightsengineering/teal.modules.general#884 ### Changes description - [x] Cleanup of `teal_data` class to allow for `teal_report` extension - [x] Change the `show()` method to remove reference to `teal_data` specifically --------- Co-authored-by: Dawid Kaledkowski <[email protected]> Co-authored-by: Marcin <[email protected]>
# Pull Request - Changes from `teal_reportable` branch at `{ŧeal.report}` - Remove old logic that was defusing the argument
Signed-off-by: Marcin <[email protected]>
Merging this to a feature branch. The rest can be dona as normal issues. Thanks!
Signed-off-by: Marcin <[email protected]>
plot_top <- plots[[1]] | ||
plot_bottom <- plots[[2]] | ||
plot <- gridExtra::grid.arrange(plot_top, plot_bottom, ncol = 1) | ||
plot <- gridExtra::arrangeGrob(plots[[1]], plots[[2]], ncol = 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused arguments (list(), "Race [RACE]")
when evaluating qenv code:
plot <- gridExtra::arrangeGrob(plots[[1]], plots[[2]], ncol = 1)
reactive({ | ||
# Version 1 | ||
# since data() is not being build up in this module, we need to create a reactive that will | ||
# return the plot in the reactive teal_data() | ||
validation_checks() | ||
obj <- data() | ||
env <- new.env() | ||
assign("plot", variable_plot_r(), envir = env) | ||
[email protected] <- rlang::env_clone(env) | ||
teal.reporter::teal_card(obj) <- | ||
c( | ||
teal.reporter::teal_card("# Variable Browser Plot"), | ||
teal.reporter::teal_card(obj), | ||
teal.reporter::teal_card("## Module's code") | ||
) | ||
teal.code::eval_code(obj, "plot") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @averissimo this module is harder as it does not build up any code to show R code. originally it only showed the plot like in Version 2 below.
With version 1 we are able to show libraries call, and filtering code, but not the plot code and it looks odd. Also I needed to overwrite @.xData
which is extremely dirty.
Do you think we rather support Version 1 or Version 2 for this module?
# VERSION 2 | ||
# validation_checks() | ||
# teal.data::teal_data(plot = variable_plot_r()) |> teal.code::eval_code("plot") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
anl_merged_q <- reactive({ | ||
req(anl_merged_input()) | ||
qenv() %>% | ||
teal.code::eval_code(as.expression(anl_merged_input()$expr)) %>% | ||
teal.code::eval_code(quote(ANL)) # used to display table when running show-r-code code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}) | ||
) | ||
|
||
decorated_summary_table_q <- srv_decorate_teal_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used later at all
card | ||
reactive( | ||
if (input$tabs == "Histogram") { | ||
c(decorated_output_dist_q(), decorated_output_summary_q(), decorated_output_test_q()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request
Fixes:
Built on top of:
teal.reporter
Cards teal#1499 (will be closed once this PR is stable)Companion PRs:
teal_report
andteal_card
class teal#1541{teal}
module returns ateal_report
object that extends fromteal_data
teal.code#255{teal}
module returns ateal_report
object that extends fromteal_data
teal.data#370teal_report
,teal_card
class and revamps reporter UI teal.reporter#331teal_report
andteal_card
class #884Changes description
teal_report
object on every module